package org.smile.homework01.kevin.Parking_handle;

public interface Generator {
    default String generateType(){             //定义车位、车辆大小的值；
        int random = generateDecimal();
        switch(random){
            case 0:
                    case 1:
                            case 2:
                                    case 3: return "小";
                                            case 4:
                                                    case 5:
                                                            case 6:
                                                                    case 7: return "中";
                                                                            case 8:
                                                                                    case 9:
                                                                                            default: return "大";
        }
    }

    default  int generateDecimal(){
        return (int)(Math.random() * 10 );
        //随机生成数字
    }
    default String generateNumber(){
        StringBuilder number = new StringBuilder();    // TODO StringBuffer函数随机生成数字并拼凑成String类型变量
        for(int i = 0; i < 5 ; i++){
            int random = generateDecimal();          //把generateDecimal方法的值传给random
            number.append(random);                   //把每个random的值加给number
        }
        return number.toString();                    //5位数循环完毕后返回number
    }
}
